{include file="index@public/header" /}
<style>
body {
  background: #e1e0de;
}
* {
  box-sizing: border-box;
}
h1,
h2,
h3,
h4 {
  font-weight: 700 !important;
}
.layui-card-header {
  width: 100%;
  border-bottom: 1px solid #999 !important;
}
.layui-card {
  padding: 10px 20px 50px;
  margin-bottom: -16px !important;
}
p {
  margin: 0 0 10px !important;
}
.layui-container {
  padding: 0 !important;
}
img {
  max-width: 100%;
}
::-moz-selection {
  background: #cccccc;
  color: #ffffff;
}
::selection {
  background: #cccccc;
  color: #ffffff;
}
.layui-breadcrumb {
  padding-left: 15px;
}
.layui-card h1 {
  margin: 10px auto 0;
}
.description {
  font-size: 15px;
  font-weight: bold;
  margin: 20px 0;
}

.body-buttom-left{ padding-right: 5px;padding-left: 5px;}
.body-buttom-right{ padding-right: 5px;padding-left: 5px;}
.layui-textarea {
  resize: none !important;
}

@media screen and (max-width: 800px) {
  .layui-card-header {
    line-height: normal !important;
    font-size: 10px !important;
  }
}

        .bearing-pdf {
            position: absolute;
            right: 8px;
            top: -10px;
            color: #cbcbcb;
            background: url(/static/uploads/2018/07/printer.png) no-repeat left center;
            padding-left: 20px;
            cursor: pointer;
        }

        #magnifier{margin-top:10px;position: relative;}
        #magnifier img{width: 100%;}
        #movescre{position:absolute;display:none;width:20%;height:30%;border:1px solid #ccc;background: #ffffcc;opacity: 0.5;filter: alpha(opacity=50);z-index: 10;cursor:pointer;}
        #magnifier_show{position:absolute;overflow:hidden;display:none;border:1px solid black;width:100%;max-width:312px;height:372px;margin-top:10px;z-index: 100}
        #magnifier_show img{position:absolute;top:0;left:0;min-width:1200px}

        tr {
            border-bottom: 1px solid #ccc;
            color:#333;
        }
        tr:hover{background-color: #36648A;color:#ffffff}
        td {
            font: 12px/14px arial,helvetica,sans-serif;
            padding: 2px 5px 2px 0px;

        }
       
    
    </style>
	
	<!-- 详情页移动适配 -->
		<style type="text/css">
			.firstbreadcrumbT{
				display: none;
			}
			@media screen and (max-width: 760px){
				.form{
					display: none;
				}
				.card-box{
					padding: 10px 0px 50px;
				}
				.layui-card-header{
					border-bottom: none !important;
					height: 25px;
					width: 65%;
					margin-bottom: 1rem;
				}
				.detail-img-box{
					position: absolute;
					top: -4.1rem;
					right: 1rem;
					width: 25%;
	
				}
				.detail-img-box>div{
					display: none;
				}
				.firstbreadcrumb{
					display: none !important;
				}
				.firstbreadcrumbT{
					display: block;
				    padding: 0 0 0 15px;
					color: #36648A ;
				}
				.secondbreadcrumb{
					display: none;
				}
				.card-box tr>td:nth-child(2){
					padding: 2px 5px 2px 15px;
				}
				.card-box table{
					width: 100%;
				}
			}
		</style>
	
 <div class="layui-container" style="width: 100%;font: 12px/14px arial,helvetica,sans-serif;">
        <div class="layui-card card-box">
         
            <div class='firstbreadcrumb' style='display: inline-block;'>
				<span class="layui-breadcrumb" lay-separator="/">
      <a href="/" style="font: 12px/14px arial,helvetica,sans-serif;">{:lang('Home')}</a>
      {foreach $crumbs as $k=>$v }
      <a href="/{$v['crumbs_url']}" style="font: 12px/14px arial,helvetica,sans-serif;color:#36648A">{$v['alias_name']}</a>
      {/foreach}
    </span>
            </div>
			<div class="firstbreadcrumbT">  		<!-- 新加内容 -->
				<a href="/product/ceramic-bearings/ceramic-components/" style='font: 12px/14px arial,helvetica,sans-serif;'>{:lang('Ceramic Components')}</a>
			</div>
            <div class="layui-card-header">
                <h1>{:lang('Ceramic Sleeve')}</h1>
            </div>

            <div class="layui-card-body">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-col-md3 detail-img-box" style='text-align: center;'>
                            <img src="{:Config::get('app.images_host')}/images/web/ceramic_10.jpg" style='padding:10px;width:80%'/>
                            <div style="font: 12px/14px arial,helvetica,sans-serif;">
                              <div style="margin: 5px 0px;font-size:0.9em">Price <span style="margin-left:5px;color:#19792f">Not yet</span></div>
                            </div>
                        </div>
                        <div class="layui-col-md9">
                          <table style='width:100%'>
                             <tbody>
                                  <tr>
                                    <td colspan="3"><strong>{:lang('TECHNICAL SPECS')}</strong></td>
                                  </tr>
                                                                    <tr>
                                    <td width="50%" colspan="2">{:lang('Material')}</td>
                                    <td width="50%">{:lang('Silicon Nitride')} (Si3N4)</td>
                                  </tr>
                                                                                                      <tr>
                                    <td colspan="2">{:lang('Color')}</td>
                                    <td>{:lang('Black')}</td>
                                  </tr>
                                  
                                                                    <tr>
                                    <td colspan="2">{:lang('Size')}</td>
                                    <td>15x25x30mm</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2">{:lang('Accuracy')}</td>
                                    <td>0.008mm</td>
                                  </tr>
                                                                   <tr>
                                    <td colspan="2">{:lang('Maximum Temperature')}</td>
                                    <td>800℃(1472F）</td>
                                  </tr>
                                  <tr>
                                                                        <td colspan="2">{:lang('Circular Runout')}</td>
                                                                        <td>15um</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2">{:lang('Perpendicularity')}</td>
                                    <td>15um</td>
                                  </tr>
                                  <tr>
                                                                        <td colspan="2">{:lang('Circularity')}</td>
                                                                        <td>12um</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2">{:lang('Parallelism')}</td>
                                    <td>20um</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2">{:lang('Applications')}</td>
                                    <td>{:lang('Chemicals, aerospace, medicine, environmental protection equipment, electronics industry, and medicine flow control valves')}</td>
                                  </tr>
                                  <tr>
                                    <td colspan="2">{:lang('RoHS')}</td>
                                    <td>{:lang('Complian')}t</td>
                                  </tr>
                                                                        <tr>
                                        <td colspan="3"><strong>{:lang('MATERIAL PROPERTIES')}</strong></td>
                                      </tr>
                                      <tr>
                                        <td rowspan="7">{:lang('Ingredients')}</td>
                                        <td>Aluninum (Al)</td>
                                        <td>2.0~3.5%</td>
                                      </tr>
                                      <tr>
                                        <td>Yttrium (Y)</td>
                                        <td>4.0~5.0%</td>
                                      </tr>
                                      <tr>
                                        <td>Titanium (Ti)</td>
                                        <td>1.0~1.5%</td>
                                      </tr>
                                      <tr>
                                        <td>Oxygan (O) </td>
                                        <td>4.5~6.0%</td>
                                      </tr>
                                      <tr>
                                        <td>Carbon(C)</td>
                                        <td>0.3~0.8%</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Other impurities less than')} 0.1%</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('The rest is silicon nitride')}</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Density')}(g/cm<sup>3</sup>)</td>
                                        <td>≥3.20</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Hardness')}(Hv)</td>
                                        <td>1400~1600</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Bending strength')}(Mpa)</td>
                                        <td>&gt;800</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Compressive strength')}(Mpa)</td>
                                        <td>&gt;4000</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Elastic Modulus')}(Gpa)</td>
                                        <td>300~315</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Fracture toughness')}(Mpa.m<sup>1/2</sup>)</td>
                                        <td>6~8</td>
                                      </tr>
                                      <tr>
                                        <td colspan="2">{:lang('Cofficient of thermal expansion')}(10<sup>-6</sup>/℃)</td>
                                        <td>2.2~3.0</td>
                                      </tr>
                                                                  </tbody>
                          </table>
                        </div>
                    </div>
                    <div class="layui-col-md5">
                      
                        <div id='magnifier' >
                               <img src="{:Config::get('app.images_host')}/images/web/Ceramic-Sleeve.jpg">
                        </div>
                    </div>
                    <div class="layui-col-md3 form">
                       <form class="layui-form" style="background-color:#36648A;padding: 10px;width:70%;margin-left:15%;border-radius:2px">
                            <h2 style='padding-bottom: 5px;color:#ffffff;margin-bottom: 10px'>Request a Quote</h2>
         
                            <div class="layui-form-item">
                             
                                <div class="layui-input-block">
                                  <input type="text" name="name" lay-verify='name' placeholder="Name" class="layui-input" />
                                  <div style="color:red;position: absolute;top:2px;left: -8px">*</div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                  <input type="text"  name="company" placeholder="Company" autocomplete="off" class="layui-input" />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block" style='position: relative'>
                                  <input type="text" name="email" lay-verify='email' placeholder="Email" class="layui-input" />
                                  <div style="color:red;position: absolute;top:2px;left: -8px">*</div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <input type="text" name="phone" placeholder="Phone Number" class="layui-input" />
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block layui-input" style="height:40px;line-height:40px">
                                  <input type="button" id="miaoshu" value="Select File" onclick="javascript:$('input[name=\'fileName\']').click();"
                                      style="background-color: #FFFFFF;border: 1px solid #ccc;font-weight: normal;color: #858585;border-radius: 5px;cursor: pointer;padding:2px 5px" class=" text" />
                                  <input name="file" placeholder="No file are selected" readonly onclick="javascript:$('input[name=\'fileName\']').click();" style="width: 60%; border: none;"/>
                                  <input type="file" id="fileName" name="fileName" style="display: none;" onchange="javascript:$('input[name=\'file\']').val(value);$('input[name=\'file\']').prop('size',this.value.length+6);" />
                              </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <div class="layui-input-block">
                                    <textarea name="comments" placeholder="How can we help?" class="layui-textarea"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item" style="text-align: center;">
                                <div class="layui-input-block">
                                  <button id='gform_submit_button_3' lay-filter="formDemo" lay-submit type='button' class="layui-btn layui-btn-sm" style="background-color: #FDD702;color: #000;font-weight: bold;border-radius: 5px;">SEND INQUIRY</button>
                                </div>
                            </div>

                        </form>
                        <div id='successfully' style="padding: 10px;width:70%;margin-left:15%;text-align:center;display:none;"><i class='layui-icon layui-icon-ok' style="font-size: 18px;color:#5FB878;"></i> <span>Sent Successfully</span></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
{include file="index@public/footer" /} 
<script type="text/javascript">
  /*提交*/
 layui.use('form', function(){
  var form = layui.form;
   /*验证规则*/
  form.verify({
    name: function(value, item){ //value：表单的值、item：表单的DOM对象
      if(value == ''){
         layer.closeAll('loading');
        return 'Please Fill In Your Name';
      }
    },
    email: function(value, item){ //value：表单的值、item：表单的DOM对象
      var t  = /^[A-Za-zd0-9]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$/;
      if(value == ''){
         layer.closeAll('loading');
        return 'Please Fill In Your Email';
      }
      if(!(t.test(value))){
         layer.closeAll('loading');
        return 'The mailbox format is incorrect';
      }
    }
    
  });

  form.on('submit(formDemo)', function(data){
    var index = layer.load(1, { shade: [0.1,'#fff'] });
    var fileName=document.getElementById('fileName').files[0];
    if(fileName!=undefined){
      if(fileName.size>2097152){
         layer.msg('The file size cannot exceed 2 megabytes',{time:2000,icon: 5});
         layer.closeAll('loading');
         return false;
      }
      /*获取后缀*/
      var flieArr = fileName.name.split('.');
         suffix = flieArr[flieArr.length - 1];
         if(suffix!=""){
          suffix = suffix.toLocaleLowerCase();
         }
      /*判断是否为允许上传的文件*/
      var allfiletype=new Array("gif", "jpeg", "jpg", "png" ,"pdf","mp4","txt","doc","xls","xlsx","mp3","docx");
      var a = allfiletype.indexOf(suffix)
      if(a == -1){
         layer.msg('Only (gif,jpeg,jpg,png,pdf,mp4,txt,doc,xls,xlsx,mp3,docx) files are allowed',{time:2000,icon: 5});
         layer.closeAll('loading');
         return false;
      }
    }

    var name=$.trim($("input[name='name']").val());
    var company=$.trim($("input[name='company']").val());
    var email=$.trim($("input[name='email']").val());
    var phone=$.trim($("input[name='phone']").val());
    var comments=$.trim($("textarea[name='comments']").val());
    var Product_Number='Ceramic Sleeve';

    var lasturl=<?php if(isset($_SERVER['HTTP_REFERER'])){ echo "'".$_SERVER['HTTP_REFERER']."'";}else{echo "'"."'";}?>;/*上一个页面的url 不能在ajax里面书写这样就多了一层页面关系*/
    var nowurl=window.location.href;/*当前页面url*/

    var formData = new FormData();
      if(fileName!=undefined){
        formData.append('file', fileName);
      }
        formData.append('name', name);
        formData.append('company', company);
        formData.append('email', email);
        formData.append('phone', phone);
        formData.append('comments', comments);
        formData.append('lasturl', lasturl);
        formData.append('nowurl', nowurl);
        formData.append('Product_Number', Product_Number);

    $.ajax({
        url: "{:url('index/Index/send_inquiry')}",/*传向后台服务器文件*/
        type: 'POST',    /*传递方法 */
        data: formData,  /*要带的值，在这里只能带一个formdata ，不可以增加其他*/
        dataType: 'json',  //传递数据的格式
        async: true, //这是重要的一步，防止重复提交的
        cache: false,  //设置为false，上传文件不需要缓存。
        contentType: false,//设置为false,因为是构造的FormData对象,所以这里设置为false。
        processData: false,//设置为false,因为data值是FormData对象，不需要对数据做处理。

        success: function (res){
          if(res.status==1){
            layer.closeAll('loading');
            $(".layui-form input").each(function(){
              $(this).val('');
            })
            $("#miaoshu").val('Select File'); 
            layer.msg(res.msg,{time:2000,icon: 1});
            $("#successfully").css('display','block');
            return false;
          }else{
            layer.msg(res.msg,{time:2000,icon: 5});
            layer.closeAll('loading');
            return false;
          }
        }
    });
 
    return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
  });
})

  
</script>
